
'use client'
import {
  del, put, post, get
} from "../utils/axios";
import Cookies from "js-cookie";

/**
 * todo 默认登录获取token
 * @returns promise 对象
 */
export function getToken(params={username:"admin",password:"fullgroup81"}) {
  return post(`/api/v1/auth/login`,params).then((res)=>{
    console.log("/api/v1/auth/login",res);
    Cookies.set("accessToken",res.accessToken)
    Cookies.set("refreshToken",res.refreshToken)
    return res
  });
}